<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var s = 'andakdwjnadkskjlawd';
        var o = {};
        for (var i = 0; i < s.length; i++) {
            if (o[s[i]]) {
                o[s[i]]++;
            } else {
                o[s[i]] = 1;
            }
        }
        console.log(o);

        var max = 0;
        for (var j in o) {
            if (o[j] > max) {
                max = o[j];
                var m = j;
            }
        }
        console.log(m, max);
    </script>
</head>

<body>

</body>

</html>